package edu.kit.aifb.lidasora.ppmModel.transitionCount;



public class LogisticalWeighting extends TransitionCount{

	private final double upperBound;
	private final double inflex;
	private final double gradient;
	
	public LogisticalWeighting(double upperBound, double inflexionPoint, double inflexGradient) {
		this.upperBound = upperBound;
		this.inflex = inflexionPoint;
		this.gradient = inflexGradient;
	}
	
	/**
	 * {inheritDoc}
	 */
	@Override
	public void truePrediction() {
		count.incrementAndGet();
		
	}

	/**
	 * {inheritDoc}
	 */
	@Override
	public void falsePrediction() {
		count.decrementAndGet();
		
	}

	/**
	 * {inheritDoc}
	 */
	@Override
	public double getTransitionValue() {
		return (upperBound  * Math.exp(gradient* (count.get() -inflex)))/(1+ Math.exp(gradient*(count.get()-inflex)));
	}

}
